﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data" 
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"
	xmlns:riaControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.DomainServices"
	xmlns:sipsorceryui="clr-namespace:SIPSorcery.UIControls"
	xmlns:local="clr-namespace:SIPSorcery"
	mc:Ignorable="d"
	x:Class="SIPSorcery.SimpleWizardManager" Width="1024" Background="Black">

	<Border x:Name="LayoutRoot" Background="Black" Width="1020" BorderThickness="1" BorderBrush="#FFA0F927" CornerRadius="5" Margin="0">
		<StackPanel Margin="0,0,0,7">
			<Canvas Height="26" Margin="8,0">
				<Button Content="X" x:Name="m_closeButton" Click="CloseButton_Click" Width="23" Height="20" Canvas.Left="977" Canvas.Top="5" />
				<TextBlock Cursor="Hand" x:Name="m_helpLink" Width="122" Foreground="{StaticResource NormalTextBrush}" Text="Simple Wizard Help" TextDecorations="Underline" TextWrapping="Wrap" MouseLeftButtonUp="HelpLink_MouseLeftButtonUp" Height="15" Canvas.Left="808" Canvas.Top="8"/>
				<TextBlock Cursor="None" x:Name="m_dialPlanName" Foreground="{StaticResource NormalTextBrush}" Text="Dial Plan Name" TextWrapping="Wrap" Height="20" Canvas.Top="5" Canvas.Left="435" FontSize="16" HorizontalAlignment="Center"/>
				<Button x:Name="_changeButton" Content="change name" Height="21" Canvas.Left="620" Canvas.Top="5" Width="91" Click="ChangeSimpleWizardDialPlanNameClick"/>
				<TextBox x:Name="_dialPlanNameTextBox" Height="25" Canvas.Left="435" TextWrapping="Wrap" Width="154" Canvas.Top="5" Visibility="Collapsed"/>
				<Button x:Name="_saveButton" Content="save" Height="21" Canvas.Left="620" Canvas.Top="5" Width="54" Visibility="Collapsed" Click="SaveSimpleWizardDialPlanNameClick"/>
			</Canvas>
			<sdk:TabControl Margin="8,0" SelectionChanged="TabControl_SelectionChanged">
				<sdk:TabControl.Background>
					<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
						<GradientStop Color="#FF3A3838"/>
						<GradientStop Color="Black" Offset="1"/>
					</LinearGradientBrush>
				</sdk:TabControl.Background>
				<sdk:TabItem Header="Outgoing Call Rules">
					<StackPanel Background="Black" Margin="0">
						<local:SimpleWizardOutRuleControl x:Name="m_outgoingRulesUpdateControl" Margin="0,0,0,5"/>
						<sipsorceryui:AssetViewPanel x:Name="m_outgoingRulesPanel" Width="977" Margin="5,0,0,0" HorizontalAlignment="Left">
							<sdk:DataGrid ColumnHeaderHeight="24" SelectionMode="Single" x:Name="m_outgoingRulesDataGrid" AutoGenerateColumns="False" FontSize="11" 
								RowBackground="Azure" 
								AlternatingRowBackground="LightSteelBlue" Margin="0" HorizontalAlignment="Left" Width="977" MouseLeftButtonUp="RulesDataGridClicked" MinHeight="231" Height="452">
								<sdk:DataGrid.Columns>
									<sdk:DataGridTextColumn 
										Header="Priority" 
										Binding="{Binding Priority}" 
										IsReadOnly="True"
										Width="70" />
									<sdk:DataGridTextColumn 
										Header="Type" 
										Width="SizeToCells"
										Binding="{Binding PatternType}" 
										IsReadOnly="True"
										MinWidth="60" />
									<sdk:DataGridTextColumn 
										Header="Pattern" 
										Width="SizeToHeader"
										Binding="{Binding Pattern}" 
										IsReadOnly="True"
										MinWidth="140" />
									<sdk:DataGridTextColumn 
										Header="Command" 
										Width="SizeToCells"
										Binding="{Binding Command}" 
										IsReadOnly="True"
										MinWidth="100" />
									<sdk:DataGridTextColumn 
										Header="Command String" 
										Width="SizeToCells"
										Binding="{Binding RuleCommandDescription}" 
										IsReadOnly="True"
										MinWidth="280" />
									<sdk:DataGridTextColumn 
										Header="Description" 
										Width="SizeToCells"
										Binding="{Binding Description}" 
										IsReadOnly="True"
										MinWidth="180" />
									<sdk:DataGridTextColumn 
										Header="Disabled" 
										Binding="{Binding IsDisabled}" 
										IsReadOnly="True"
										Width="70" />
									<sdk:DataGridTemplateColumn Header="Delete" MinWidth="100">
										<sdk:DataGridTemplateColumn.CellTemplate>
											<DataTemplate>
												<TextBlock Cursor="Hand" Foreground="Purple" Text="delete" TextDecorations="Underline" MouseLeftButtonUp="DeleteSimpleWizardRule" HorizontalAlignment="Center" />
											</DataTemplate>
										</sdk:DataGridTemplateColumn.CellTemplate>
									</sdk:DataGridTemplateColumn>
								</sdk:DataGrid.Columns>
							</sdk:DataGrid>
						</sipsorceryui:AssetViewPanel>	
					</StackPanel>	
				</sdk:TabItem>
				<sdk:TabItem Header="Incoming Call Rules">
					<StackPanel Background="Black" Margin="0">
						<local:SimpleWizardInRuleControl x:Name="m_incomingRulesUpdateControl" Margin="0,0,0,5"/>
						<sipsorceryui:AssetViewPanel x:Name="m_incomingRulesPanel" Width="977" Margin="5,0,0,0" HorizontalAlignment="Left">
							<sdk:DataGrid ColumnHeaderHeight="24" SelectionMode="Single" x:Name="m_incomingRulesDataGrid" AutoGenerateColumns="False" FontSize="11" 
								RowBackground="Azure" 
								AlternatingRowBackground="LightSteelBlue" Margin="0" HorizontalAlignment="Left" Width="977" MouseLeftButtonUp="RulesDataGridClicked" MinHeight="231" Height="452" ScrollViewer.VerticalScrollBarVisibility="Auto" ScrollViewer.HorizontalScrollBarVisibility="Auto">
								<sdk:DataGrid.Columns>
									<sdk:DataGridTextColumn 
										Header="Priority" 
										Binding="{Binding Priority}" 
										IsReadOnly="True"
										Width="70" />
									<sdk:DataGridTextColumn 
										Header="Match Type" 
										Binding="{Binding ToMatchType}" 
										IsReadOnly="True"
										Width="100" />
									<sdk:DataGridTextColumn 
										Header="To Match Pattern" 
										Width="SizeToHeader"
										Binding="{Binding ToMatchParameter}" 
										IsReadOnly="True"
										MinWidth="160" />
									<sdk:DataGridTextColumn 
										Header="Caller ID Match" 
										Width="SizeToHeader"
										Binding="{Binding Pattern}" 
										IsReadOnly="True"
										MinWidth="140" />
									<sdk:DataGridTextColumn 
										Header="Command" 
										Width="SizeToCells"
										Binding="{Binding Command}" 
										IsReadOnly="True"
										MinWidth="100" />
									<sdk:DataGridTextColumn 
										Header="Time" 
										Width="SizeToCells"
										Binding="{Binding TimePattern}" 
										IsReadOnly="True"
										MinWidth="60" />
									<sdk:DataGridTextColumn 
										Header="Command String" 
										Width="SizeToCells"
										Binding="{Binding RuleCommandDescription}" 
										IsReadOnly="True"
										MinWidth="260" />
									<sdk:DataGridTextColumn 
										Header="Description" 
										Width="SizeToCells"
										Binding="{Binding Description}" 
										IsReadOnly="True"
										MinWidth="180" />
									<sdk:DataGridTextColumn 
										Header="Disabled" 
										Binding="{Binding IsDisabled}" 
										IsReadOnly="True"
										Width="70" />
									<sdk:DataGridTemplateColumn Header="Delete" MinWidth="100">
										<sdk:DataGridTemplateColumn.CellTemplate>
											<DataTemplate>
												<TextBlock Cursor="Hand" Foreground="Purple" Text="delete" TextDecorations="Underline" MouseLeftButtonUp="DeleteSimpleWizardRule" HorizontalAlignment="Center" />
											</DataTemplate>
										</sdk:DataGridTemplateColumn.CellTemplate>
									</sdk:DataGridTemplateColumn>
								</sdk:DataGrid.Columns>
							</sdk:DataGrid>
						</sipsorceryui:AssetViewPanel>	
					</StackPanel>	
				</sdk:TabItem>
			</sdk:TabControl>
		</StackPanel>
	</Border>
</UserControl>